﻿using _17bang.Entities;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using E = _17bang.Entities;
using _17bang.Repositories;



namespace _17bang.Pages.Shared
{
    public class SingleModel : PageModel
    {
        private SingleRepository singleRepository;

        public SingleModel()
        {
            singleRepository = new SingleRepository();
        }
        public E.Article Article { get; set; }

        public void OnGet()
        {
            //int id = Convert.ToInt32(Request.Query["id"]);
            int id = Convert.ToInt32(RouteData.Values["id"]);

            Article = singleRepository.Find(id);

        }

    }
}
